import os

from PyQt4 import QtCore, QtGui

from fonttreeview import FontTreeView


class BrowsePane(QtGui.QWidget):
	'''A pane containing combobox and a list view with fonts in the selected folder'''

	def __init__(self, parent=None):
		QtGui.QWidget.__init__(self, parent)

		self.layout = QtGui.QVBoxLayout()
		self.setLayout(self.layout)

		self.dirsComboBox = QtGui.QComboBox(self)
		#FIXME: for testing purposes
		self.dirsComboBox.addItem("/home/download/Fonts/Fonts")
		
		self.fontsView = FontTreeView(self, self.dirsComboBox.currentText())
		self.layout.addWidget(self.dirsComboBox)
		self.layout.addWidget(self.fontsView)

		self.connect(self.dirsComboBox, QtCore.SIGNAL("activated (const QString&)"), self.fontsView.changeFolder)



if __name__ == '__main__':
	app = QtGui.QApplication([])
	bp = BrowsePane()
	bp.show()
	app.exec_()
